<?php	
	
include ("./src/jpgraph.php");
include ("./src/jpgraph_line.php");
$graph = new Graph(900,550,"auto");
$graph->SetScale("textlin");

$graph->img->SetMargin(50,30,20,120);    
$graph->SetShadow();

$datax=array("V","Tomm","Atda","Boto","Tojo","mCm","Dres","Fran","Trep","Trem","Aren","Llvi","Llde","Cara","Ashg","Ldov","Wenl","Ludl","Prid","Gedi","Sieg","Emsi","Eife","Give","Fras","Fame","Tour","Vise","Serp","Bash","Mosc","Step","wolf","Leon","Guad","Tatr","Indu","Olen","Anis","Ladi","Carn","Nori","Hett","Sine","Plie","Toar","Aale","Bajo","Bath","Call","Oxfo","Kimm","Tith","Berr","Vala","Haut","Barr","Apti","Albi","Ceno","Turo","Coni","Sant","Camp","Maas","Dani","Than","Eo-l","Eo-m","Eo-u","Ol-l","Ol-u","Mi-l","Mi-m","Mi-u","Plio-l","Plio-u","Plei-l","Plei-u","R");
$datay=array("1","31","125","247","133","490","223","213","238","163","183","82","75","150","195","41","49","43","33","33","40","40","163","62","30","42","18","41","12","8","15","14","5","10","17","10","0","0","5","4","0","5","0","1","0","0","0","0","0","1","0","1","4","0","0","0","0","0","1","2","0","0","0","5","21","4","2","0","3","4","0","3","0","0","2","0","3","0","0","0");

$datay2=array("0","0","9","5","2","17","1","1","4","14","39","18","29","51","115","13","51","97","52","23","40","83","55","85","81","85","43","90","56","11","48","69","23","71","152","161","19","50","24","106","121","230","9","37","40","65","9","51","48","62","69","67","229","22","20","42","20","78","134","212","56","23","70","196","839","115","127","114","319","425","155","130","119","186","351","34","259","1","35","0");

$datay3=array("1","0","2","10","7","22","6","4","49","55","210","137","120","302","474","235","314","297","172","165","130","370","502","480","374","407","223","513","308","127","121","211","201","361","461","344","35","130","117","90","161","350","17","69","142","136","43","163","118","207","135","112","245","45","79","75","83","121","222","156","79","47","54","95","347","52","38","14","20","73","17","43","9","18","70","1","36","0","8","0");


$graph->title->Set("Sepkoski Curve/Special Graph 1 Extinction");
$graph->title->SetFont(FF_FONT1,FS_BOLD);


$dplot = new LinePLot($datay);
$dplot2 = new LinePLot($datay2);
$dplot3 = new LinePLot($datay3);

$dplot->SetFillColor("blue");
$dplot2->SetFillColor("green");
$dplot3->SetFillColor("red");

$dplot->SetLegend("Cm");
$dplot2->SetLegend("Md");
$dplot3->SetLegend("Pz");


// Create the accumulated graph
$accplot = new AccLinePlot(array($dplot,$dplot3, $dplot2));

// Add the plot to the graph
$graph->Add($accplot);

//$p1 = new LinePlot($datay);
//$p1->SetFillColor("blue");
//$p1->mark->SetType(MARK_FILLEDCIRCLE);
//$p1->mark->SetFillColor("red");
//$p1->mark->SetWidth(4);
$graph->yaxis->title->SetMargin(10);

$graph->yaxis->title->Set("Number of Genera");
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->title->SetMargin(80);
$graph->xaxis->title->Set("Stage Interval");

$graph->Stroke();
?>